home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / examples / exam05 / main.c < prev    next >
C/C++ Source or Header  |  1995-09-27  |  1KB  |  87 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. /*
  7.  *
  8.  *    This source code is CONFIDENTIAL and
  9.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  10.  *    distribution, adaptation or use    may
  11.  *    be subject to civil and    criminal penalties.
  12.  *
  13.  *    Copyright (c) 1993 Algorithms Corporation
  14.  *    3020 Liberty Hills Drive
  15.  *    Franklin, TN  37064
  16.  *
  17.  *    ALL RIGHTS RESERVED.
  18.  *
  19.  *
  20.  *
  21.  */
  22.  
  23.  
  24.  
  25. #include "generics.h"
  26.  
  27.  
  28. main(int argc, char *argv[])
  29. {
  30.     object    linkObject, seq, obj;
  31.  
  32.  
  33.     InitDynace(&argc);
  34.  
  35.  
  36.     /*  Create and initialize a LinkObject  */
  37.  
  38.     linkObject = gNew(LinkObject);
  39.     gAddFirst(linkObject, gNewWithStr(String, "The first element added."));
  40.     gAddFirst(linkObject, gNewWithDouble(DoubleFloat, 3.14159));
  41.     gAddLast(linkObject, gNewWithLong(LongInteger, 186282L));
  42.     gPrint(linkObject, stdoutStream);
  43.  
  44.  
  45.     /*  Create an instance of LinkObjectSequence (with gSequence)
  46.         and use it to sequence through all the elements of the
  47.         list.  Print each element.  */
  48.  
  49.     for (seq = gSequence(linkObject)  ;  obj = gNext(seq) ; )
  50.         gPrint(obj, stdoutStream);
  51.  
  52.  
  53.     /*  Print entire list to show its not changed.  */
  54.  
  55.     gPrint(linkObject, stdoutStream);
  56.  
  57.  
  58.     gDeepDispose(linkObject);
  59.     
  60.     return 0;
  61. }
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. /*
  70.  *
  71.  *    This source code is CONFIDENTIAL and
  72.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  73.  *    distribution, adaptation or use    may
  74.  *    be subject to civil and    criminal penalties.
  75.  *
  76.  *    Copyright (c) 1993 Algorithms Corporation
  77.  *    3020 Liberty Hills Drive
  78.  *    Franklin, TN  37064
  79.  *
  80.  *    ALL RIGHTS RESERVED.
  81.  *
  82.  *
  83.  *
  84.  */
  85.  
  86.  
  87.